﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
using WisDom.SmartTMS.Enums;

namespace WisDom.SmartTMS.Entities
{
    /// <summary>
    /// 审核明细表
    /// </summary>
   public class BusinessAuditLogs:Entity<Guid>
    {
        /// <summary>
        /// 业务编号ID
        /// </summary>
        public Guid BusinessCode { get; set; }

        /// <summary>
        /// 审核人ID
        /// </summary>
        public Guid ProcessPersionCode { get; set; }

        /// <summary>
        /// 审核人姓名
        /// </summary>
        [StringLength(100)]
        public String ProcessPersionName { get; set; }

        /// <summary>
        /// 审核结果0审核中，1同意，2拒绝
        /// </summary>
        public AuditState ProcessResult { get; set; }

        /// <summary>
        /// 最后审核结束时间
        /// </summary>
        public DateTime? AuditTime { get; set; }

        /// <summary>
        /// 审核备注信息
        /// </summary>
        [StringLength(100)]
        public String Remark { get; set; }

        /// <summary>
        /// 是否发启审核人部门领导
        /// </summary>
        public Boolean IsDepBoss { get; set; }

        /// <summary>
        /// 创建人ID
        /// </summary>
        public Guid CreatorID { get; set; }

        /// <summary>
        /// 创建人姓名
        /// </summary>
        [StringLength(100)]
        public String CreatorRealName { get; set; }

        /// <summary>
        /// 是否已删除
        /// </summary>
        public Boolean Deleted { get; set; }

        /// <summary>
        /// 创建时间（审核发启时间）
        /// </summary>
        public DateTime? CreateTime { get; set; }

        protected BusinessAuditLogs()
        { 
        }
        public BusinessAuditLogs(Guid id,Guid businessCode,Guid processPersionCode,string processPersionName,AuditState processResult)
        {
            Id = id;//主键
            BusinessCode = businessCode;//业务编号
            ProcessPersionCode = processPersionCode;//审核人ID
            ProcessPersionName = processPersionName;//审核人姓名
            ProcessResult =processResult;//审核状态
            AuditTime = AuditTime;//最后审核时间
            Remark = Remark;//备注
            IsDepBoss = IsDepBoss;//是否发启审核人部门领导
            CreatorID = id;//创建人ID
            CreatorRealName = CreatorRealName;//创建人姓名
            Deleted = Deleted;//是否删除
            CreateTime = CreateTime;//创建时间

        }

        /// <summary>
        /// 修改审核状态
        /// </summary>
        /// <param name="processResult"></param>
        /// <param name="remark"></param>
        /// <param name="createTime"></param>

        public void UptLogs(AuditState processResult,string remark)
        {
            ProcessResult = processResult;//审核状态
            Remark = remark;//备注
        }


    }
}
